home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The World of Computer Software
/
The World of Computer Software.iso
/
compugr.zip
/
COMPUPGR.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-08-20
|
2KB
|
73 lines
{
This was generated as something of a joke, so try to keep a sense of humor.
One player noted that he had something "that detected a complex tree of 19
sectors protected by a single sector". Another person asked that "why
doesn't somebody just write an offline utility called "the computer upgrade"
so that we can at last answer yes and be done with it. Here it is, guys...
}
{ I keep forgetting to turn off 286 instruction set. So, better force it
off here, before I confuse any more 286 people. }
{$A+} { speed up us 80x86 guys }
{$B-} { I dig short circuits }
{$I+} { pisses people off when they hit a letter, but its better than
gigo. }
{$G-} { turn OFF 286 instruction set }
program cut_point_analysis;
uses DOS;
{$I headers.inc}
type
sectorSet = array [ sector ] of boolean;
var
BBSName : string;
space : TheVoid;
s, i : sector;
basegraph,
subgraph : sectorSet;
basecount,
access : sectorindex;
{$I QUEUE.INC }
{$I status.inc }
{$I misc.inc }
{$I PortStat.inc }
{$I gsdata.inc }
{$I subgraph.inc}
begin {main}
writeln('The Computer UPGRADE! : ', Version);
writeln( author );
writeln( source );
writeln;
InitSpace( Space );
if paramcount > 0 then
BBSName := paramstr( 1 )
else
BBSName := '';
GetData( space, BBSName, true );
for s := 1 to maxSector do
with space.sectors[s] do
etc := etc and (not Avoid);
basecount := achievable( space.sectors, 1, basegraph );
for s := 2 to maxSector do
begin
with space.sectors[s] do
etc := etc or Avoid; { mark inaccessible }
access := achievable( space.sectors, 1, subgraph); { find connected }
with space.sectors[s] do
etc := etc and (not Avoid); { mark available again }
if access < basecount then
begin
write('Sector ', s, ' protects ');
for i := 2 to maxSector do
if basegraph[i] and (not subgraph[ i ]) then write( i : 4, ' ');
writeln;
end; {if subgraph is proper}
end; {for s}
end.